#!/bin/bash

#. "${HOME}/.bashrc"

filename=${PLT_PATH}/actio/dir_fp_f_/fp_f_extst/extst_1/ex3/exec._extst 

# echo -e "${HLIGHT}---start file://$filename ---${NORMAL}" # start file

idir=$(pwd)

# cd "$(prs_f -d $filename)" || qq_exit "$(prs_f -d filename) not found"

dir=$(prs_f -d "$filename")
cd "$dir" || plt_exit
. "$dir"/_flow_tst.sh &>/dev/null
# . "$dir"/_flow_tst.sh &>res

# cd "$dir"/use/ || qq_exit

# ./main.bexe &>res

#? if res, pre dirs -> diff -qr | diff -r

flag=1
# diff_=$(diff -r "$dir"/_deb/pre/dir_nnn2_ "$dir"/_deb/res/dir_nnn2_)
if ! diff -qr "$dir"/_deb/pre/dir_ex3_ "$dir"/_deb/res/dir_ex3_ 1>/dev/null 2>/dev/null; then
    flag=0
fi
# echo "${flag}"
if [ 0 -eq "${flag}" ]; then
    echo "ANY in file://$dir fail" >&2
    diff -r "$dir"/_deb/pre/dir_ex3_ "$dir"/_deb/res/dir_ex3_ >&2
    # echo ${diff_} >&2
    return 1
else
    echo "ALL in $dir true"
    return 0
fi

cd "$idir"

unset filename